﻿#ifndef RNDR_H
#define RNDR_H

#include<SDL/SDL.h>
#include"CubeManager.h"
#include"CameraManager.h"
#include"Floor.h" 
#include"World.h"

/*************************************************************************************/

class Render{
public:

	Floor floor;
	CubeManager cubes;
	CameraManager cameras;
	World world;

	float posx, posy, z, r, speed; //r to promień tego czerwonego kółka
	Uint8 * keystate;

	bool isrunning;

	float scale;

	SDL_Surface * screen;
	const SDL_VideoInfo * info;

	int SCREEN_WIDTH;
	int SCREEN_HEIGHT;
	int BPP;

//Constructor
	Render(){
		posx = 0.0f;
		posy = 0.0f;
		z = 6000.0f;
		r = 10.0f;
		speed = 200.0f;
		isrunning = true;
		scale = 1.0f;

		screen = NULL;
		info = NULL;

		SCREEN_WIDTH = 0;
		SCREEN_HEIGHT = 0;
		BPP = 0;
	}

//Method
	void SetupRC();
	void ChangeSize(int width, int height);
	void quit(int code);
	void InitOpenGLAndSDL(int w = 800, int h = 600, int flags = SDL_OPENGL | SDL_SWSURFACE | SDL_DOUBLEBUF);
	
	void RenderScene(void);
	void Keypress(SDL_keysym* keysymptr);
	void Keyrelease(SDL_keysym *keysymptr);
};

#endif